home *** CD-ROM | disk | FTP | other *** search
- Path: norconnect.no!not-for-mail
- From: kenneth@norconnect.no (Kenneth C. Nilsen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: asm code needed to check thecurrent processor ...
- Date: 19 Jan 1996 05:40:40 +0100
- Organization: NorConnect Internet Services AS
- Message-ID: <1771.6592T235T1312@norconnect.no>
- References: <4d1j99$fs6@rc1.vub.ac.be>
- NNTP-Posting-Host: norconnect.no
- X-Newsreader: THOR 2.21 (Amiga;SOUP)
-
- > hi, I'm looking for some asm code to check current processor
- >(680x0) available, fpu, mmu on a Amiga.
- > I'f you have some routines ... could you send it to me ...
-
- I believe I have answered this before, but here we go again:
- (Sources from my dfunc.library (aminet:util/libs/DFunc3714.lha)
-
- Usage: bsr.b GetProc
- d0=processor
-
-
- include exec/execbase.i
-
- GetProc move.l a6,-(sp) ;GetProc() ()
-
- move.l $4.w,a6
- move.w 296(a6),d1
-
- .060 move.l #68060,d0 ;check if 68060
- btst #AFB_68060,d1
- beq.b .040
- btst #AFB_FPU40,d1
- bne.b .040
- bra.b .End
-
- .040 move.l #68040,d0 ;check if 68040
- btst #AFB_68040,d1
- beq.b .030
- bra.b .End
-
- .030 move.l #68030,d0 ;check if 68030
- btst #AFB_68030,d1
- beq.b .020
- bra.b .End
-
- .020 move.l #68020,d0 ;check if 68020
- btst #AFB_68020,d1
- beq.b .010
- bra.b .End
-
- .010 move.l #68010,d0 ;check if 68010
- btst #AFB_68010,d1
- beq.b .000
- bra.b .End
-
- .000 move.l #68000,d0 ;it's a 68000
-
- .End move.l (sp)+,a6
- rts
- *╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗╗*
- And this routine is to check for which math-processor currently installed:
-
- Usage: bsr.b GetMath
- d0=fpu
-
-
- GetMath move.l a6,-(sp) ;GetMath() ()
-
- move.l $4.w,a6
- move.w 296(a6),d1
-
- .040 move.l #68040,d0 ;check if FPU40 (only on 040/060)
- btst #AFB_FPU40,d1
- beq.b .882
- bra.b .End
-
- .882 move.l #68882,d0 ;check if 68882
- btst #AFB_68882,d1
- beq.b .881
- bra.b .End
-
- .881 move.l #68881,d0 ;check if 68881
- btst #AFB_68881,d1
- beq.b .0
- bra.b .End
-
- .0 moveq #0,d0 ;no FPU
-
- .End move.l (sp)+,a6
- rts
-
-
- Hope this will help.
-
-
- ---
- CREATIVE LINKS __ Kenneth C. Nilsen
- http://www.norconnect.no/~kenneth /_/\ e-mail: kenneth@norconnect.no
- "Everything you want" \_\/ Software & MultiMedia developer
-
-